# class MathOperations:
#     def __init__(self):
#         pass
#
#     def sum_numbers(self, numbers):
#         total = 0
#         for num in numbers:
#             total += num
#         return total
#
#     def multiply_numbers(self, numbers):
#         total = 1
#         for num in numbers:
#             total *= num
#         return total
#
#
# def main():
#     math_ops = MathOperations()
#     input_str = input("请输入一系列数字，用空格分隔：")
#     numbers = list(map(float, input_str.split()))
#     choice = input("请选择操作：求和(sum) 或 求乘积(multiply)？")
#
#     if choice == "sum":
#         result = math_ops.sum_numbers(numbers)
#         print("和为：", result)
#     elif choice == "multiply":
#         result = math_ops.multiply_numbers(numbers)
#         print("乘积为：", result)
#     else:
#         print("输入的操作无效。")
#
#
# if __name__ == "__main__":
#     main()

import numpy as np


def sum_and_product(numbers_str):
    numbers_list = [int(num) for num in numbers_str.split(',')]
    numbers_array = np.array(numbers_list)
    total_sum = np.sum(numbers_array)
    total_product = np.prod(numbers_array)
    return total_sum, total_product


# 示例用法
if __name__ == "__main__":
    input_str = input("请输入一系列由逗号分隔的数字（例如：1,2,3,4）: ")
    sum_result, product_result = sum_and_product(input_str)
    print(f"这些数字的和是: {sum_result}")
    print(f"这些数字的积是: {product_result}")